﻿using System;
using Manager;
using UnityEngine.EventSystems;

namespace UnityEngine.UI
{
	// Token: 0x02000540 RID: 1344
	public class ButtonPlaySE : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IPointerClickHandler, IEventSystemHandler
	{
		// Token: 0x06002270 RID: 8816 RVA: 0x000CFBCC File Offset: 0x000CDDCC
		private void PlaySE()
		{
			int se = (int)this._SE;
			if (se >= Enum.GetValues(typeof(ButtonPlaySE.SE)).Length)
			{
				return;
			}
			Singleton<Manager.Sound>.Instance.Play(Manager.Sound.Type.SystemSE, "sound/data/systemse/00.unity3d", this.seName[se], 0f, 0f, true, true, -1, true);
		}

		// Token: 0x06002271 RID: 8817 RVA: 0x000CFC24 File Offset: 0x000CDE24
		public void OnPointerClick(PointerEventData eventData)
		{
			if (this._Type != ButtonPlaySE.Type.Click)
			{
				return;
			}
			if (!Input.GetMouseButtonUp(0))
			{
				return;
			}
			this.PlaySE();
		}

		// Token: 0x06002272 RID: 8818 RVA: 0x000CFC44 File Offset: 0x000CDE44
		public void OnPointerDown(PointerEventData eventData)
		{
			if (this._Type != ButtonPlaySE.Type.Down)
			{
				return;
			}
			if (!Input.GetMouseButtonDown(0))
			{
				return;
			}
			this.PlaySE();
		}

		// Token: 0x06002273 RID: 8819 RVA: 0x000CFC68 File Offset: 0x000CDE68
		public void OnPointerUp(PointerEventData eventData)
		{
			if (this._Type != ButtonPlaySE.Type.Up)
			{
				return;
			}
			if (!Input.GetMouseButtonUp(0))
			{
				return;
			}
			this.PlaySE();
		}

		// Token: 0x04002386 RID: 9094
		private string[] seName = new string[]
		{
			"sse_00_02",
			"sse_00_03",
			"sse_00_04",
			"sse_00_01",
			"sse_00_06",
			"sse_00_07",
			"sse_00_08",
			"sse_00_05"
		};

		// Token: 0x04002387 RID: 9095
		public ButtonPlaySE.Type _Type;

		// Token: 0x04002388 RID: 9096
		public ButtonPlaySE.SE _SE;

		// Token: 0x02000541 RID: 1345
		public enum Type
		{
			// Token: 0x0400238A RID: 9098
			Click,
			// Token: 0x0400238B RID: 9099
			Down,
			// Token: 0x0400238C RID: 9100
			Up
		}

		// Token: 0x02000542 RID: 1346
		public enum SE
		{
			// Token: 0x0400238E RID: 9102
			ok_s,
			// Token: 0x0400238F RID: 9103
			ok_l,
			// Token: 0x04002390 RID: 9104
			cancel,
			// Token: 0x04002391 RID: 9105
			sel,
			// Token: 0x04002392 RID: 9106
			ok_s2,
			// Token: 0x04002393 RID: 9107
			window_o,
			// Token: 0x04002394 RID: 9108
			save,
			// Token: 0x04002395 RID: 9109
			photo
		}
	}
}
